- unless @blog.blog_photo.url=="/blog_photos/original/missing.png"
  #photo{:style=>'float:left;width:330px; margin-right: 20px;'}
    %div{:style=>'text-align:center;'}= image_tag @blog.blog_photo.url, :width=>"300"
#profile
  %h2= @user.full_name
  %p= @blog.profile
  %p
    หน่วยงาน:
    = @user.org
  - if @user.lao
    %p
      อปท.:
      = @user.lao.th
  %p{:style=>'font-style:italic; font-size:small; color:#E98E75;'}
    = link_to "http://pass.dpe.go.th/blog/show?user=#{@user.login}", "http://pass.dpe.go.th/blog/show?user=#{@user.login}"
  - if blog_owner?
    %p
      %div{:style=>'float:left;'}= button_to "เพิ่มข้อความ", :action=>"add_post"
      %div{:style=>'float:left;'}= button_to "เพิ่มรูปภาพ", :action=>"add_photo"
      %div{:style=>'float:left;'}= button_to "เพิ่ม widget", :action=>"add_widget"
  - if admin?
    %p
    %div{:style=>'float:left;'}= button_to "ลบ blog นี้", {:action=>"destroy_blog", :blog_id=>@blog.id}, :confirm=>"กรุณายืนยัน"
    %div{:style=>'float:left;'}= button_to "ระงับการสร้าง blog", {:action=>"ban_blog", :user_id=>@user.id}, :confirm=>"กรุณายืนยัน"
.bar= image_tag "bar.gif"
- @posts.each do |post|
  .date
    = date_thai post.created_at, :time=>true
    - if blog_owner?
      = link_to "ลบ", {:action=>:destroy_post, :id=>post.id}, :confirm=>"ยืนยัน"
  - if post.post_photo.exists?
    %div{:style=>'text-align:center;'}= image_tag post.post_photo.url
    .body= h(post.body) unless post.body.blank?
  - elsif post.widget
    %div{:style=>'text-align:center;'}= post.widget
  - else
    .post_subject
      = h(post.subject) unless post.subject.blank?
    .body= post.body unless post.body.blank?
  .bar= image_tag "bar.gif"
= will_paginate @posts, :previous_label => '&laquo; หน้าก่อน', :next_label => 'หน้าถัดไป &raquo;'
